package com.epam.giorgadze.task4.Entity;

import java.util.Random;

public class Book {
    private int bookID;
    private String bookName;
    private String bookAuthor;

    public int getBookID() {
        return bookID;
    }

    public void setBookID(int bookID) {
        this.bookID = bookID;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getBookAuthor() {
        return bookAuthor;
    }

    public void setBookAuthor(String bookAuthor) {
        this.bookAuthor = bookAuthor;
    }
    
    public void using() {
        Random rand = new Random();
        try {
            Thread.sleep(rand.nextInt(500));
        }
        catch(InterruptedException e) {
            e.printStackTrace();
        }
    }

    @Override
    public String toString() {
        return "Book "  + bookID + " " + bookName + " by " + bookAuthor;
    }

    public Book(int bookID, String bookName, String bookAuthor) {
        this.bookID = bookID;
        this.bookName = bookName;
        this.bookAuthor = bookAuthor;
    }
   
    
    
}
